package org.ccay.manage.log.service;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.ccay.core.base.BatchVO;
import org.ccay.core.base.PageVO;
import org.ccay.core.base.PagedResult;
import org.ccay.core.exception.ApplicationException;
import org.ccay.log.SqlTraceVO;


/**
 * SQL TRACE service
 * @author chaowangbang
 *
 */
@Path("/sqlTrace")
@Produces("application/json")
public interface ISqlTraceService {
	/**
	 * 查询SqlTraceVO列表
	 * @param pageVO
	 * @return
	 * @throws ApplicationException
	 */
	@GET
	@Path("list/page/{pageSize}/{curPage}")
	public PagedResult<SqlTraceVO> findSqlTraceList(@QueryParam("")	SqlTraceVO sqlTraceVO, @PathParam("") PageVO pageVO) throws ApplicationException;
	
	/**
	 * 批量操作SqlTraceVO
	 */
	@PUT
	@Path("/batch")
	public void batchOperation(BatchVO<SqlTraceVO> batchItems) throws ApplicationException;

	/**
	 * 批量增加SqlTraceVO
	 * @param newSqlTraceVO
	 * @throws ApplicationException
	 */
	@POST
	@Path("/list")
	public void createSqlTraceList(List<SqlTraceVO> newSqlTraceVO) throws ApplicationException;
	
	/**
	 * 批量删除SqlTraceVO
	 * @param existSqlTraceVO
	 * @throws ApplicationException
	 */
	@PUT
	@Path("/delete")
	public void deleteSqlTraceList(List<SqlTraceVO> existSqlTraceVO) throws ApplicationException;
	
	/** 
	 * 查询SqlTrace信息
	 * @return
	 *//*
	@GET
	@Path("/summary")
	Map<String,String> findSqlTraceInfo();
	*/
	/** 
	 * 写入内存SqlTrace信息
	 * @return
	 */
	@PUT
	@Path("/start")
	public void startSqlTrace(List<SqlTraceVO> selectedSqlTraceVO)throws ApplicationException;
	
	/** 
	 * 查询SqlTrace信息,设置开关为“关”
	 * @return
	 */
	@PUT
	@Path("/stop")
	public void stopSqlTrace(List<SqlTraceVO> stoppedSqlTraceVO)throws ApplicationException;
	
	/**
	 * 启动 SQL Trace集群
	 * @param sqlTrace
	 * @throws ApplicationException
	 */
	@PUT
	@Path("/startCluster")
	public void startClusterSqlTrace(List<SqlTraceVO> sqlTrace) throws ApplicationException;

	/**
	 * 停止 SQL Trace集群
	 * @param sqlTrace
	 * @throws ApplicationException
	 */
	@PUT
	@Path("/stopCluster")
	public void stopClusterSqlTrace(List<SqlTraceVO> sqlTrace) throws ApplicationException;
}
